using PKGames.Localization.Currency;
using System;
using UnityEngine;

namespace PKGames.Localization
{
	[Serializable]
	public class CurrencyCollection : ScriptableObject
	{
		[SerializeField]
		private TextAsset _asset;

		private CurrencyDataList _currencyDataList;

		public string GetCurrencyCode(string iso4217String)
		{
			if (_currencyDataList == null || _currencyDataList.MappedDictionary.Count == 0)
			{
				_currencyDataList = JsonUtility.FromJson<CurrencyDataList>(_asset.text);
			}
			CurrencyDataList currencyDataList = new CurrencyDataList();
			CurrencyData currencyData = new CurrencyData();
			currencyData.isoCode = "ab";
			currencyData.currencyString = "cd";
			currencyDataList.Update(currencyData);
			UnityEngine.Debug.Log(JsonUtility.ToJson(currencyDataList));
			return (!_currencyDataList.MappedDictionary.ContainsKey(iso4217String)) ? iso4217String : _currencyDataList.MappedDictionary[iso4217String].CurrencyString;
		}
	}
}
